package org.computate.model.item;

import java.util.List;

import com.googlecode.objectify.annotation.Cached;
import com.googlecode.objectify.annotation.Subclass;

@Cached
@Subclass
public class Grave extends Model {
	
	public String getModelDisplayName() { return "Grave"; }
	public String getModelPluralName() { return "Graves"; }
	public String getAddLink() { return "/page/item/Grave/GraveAdd.jsp"; }
	public String getAddLinkName() { return "Add a new grave"; }
	
	private String familyName;
	private String front;
	private String back;
	private String left;
	private String right;
	private List<BuriedPerson> buriedPeople;
	
	public Grave() {
		super();
		setPhotosPermitted(true);
		setOrder("created");
	}
	
	@Override
	public String getName() {
		return familyName;
	}
	
	@Override
	public void addFields() {
		super.addFields();
		
		removeField("name");
		addField("familyName", "Family Name");
		addField("front", "Front Text").setTextarea(true).setWysiwyg(true);
		addField("back", "Back Text").setTextarea(true).setWysiwyg(true);
		addField("left", "Left Text").setTextarea(true).setWysiwyg(true);
		addField("right", "Right Text").setTextarea(true).setWysiwyg(true);
		addField("buriedPeople", "Buried People");
	}
	public String getFamilyName() {
		return familyName;
	}
	public void setFamilyName(String familyName) {
		this.familyName = familyName;
	}
	public String getFront() {
		return front;
	}
	public void setFront(String front) {
		this.front = front;
	}
	public String getBack() {
		return back;
	}
	public void setBack(String back) {
		this.back = back;
	}
	public String getLeft() {
		return left;
	}
	public void setLeft(String left) {
		this.left = left;
	}
	public String getRight() {
		return right;
	}
	public void setRight(String right) {
		this.right = right;
	}
	public List<BuriedPerson> getBuriedPeople() {
		return buriedPeople;
	}
	public void setBuriedPeople(List<BuriedPerson> buriedPeople) {
		this.buriedPeople = buriedPeople;
	}
}
